<?php
use yii\helpers\Url;
use yii\helpers\Html;
use frontend\models\operate\User;
	$session = yii::$app->session;
    $user_id = $session->get('user_id');
    if(!empty($user_id))
    {
        $user = User::find()->select("user_id,user_name,user_thumb")->where("user_id=$user_id")->asarray()->one();
    }
    else
    {
        $user = "";
    }
$data = $this->context->common();
$notice = $data['notice'];
$hot = $data['hot'];
$label = $data['label'];
?>
<div class="column-col main-area-right">
<div class="column-col main-area-right">
<div class="ibox">
<div class="ibox-in">
<div class="ibox-head">
<span class="ibox-tit-text">问答版规</span>
</div>
<div class="ibox-body">
<ul class="notice-information">
<li>
	<?php foreach ($notice as $key => $no) {?>
        <p><?php echo $key+1;?>、<?php echo $no['config_value']?><br/><br/></p>
    <?php }?>
</li>

</ul>
</div>
</div>
</div>
</div>

<div id="hotTag" class="ibox"><div class="ibox-in"><div class="ibox-head"><div class="ibox-tit-text">热门标签</div></div> <div class="hot-tag-box"><div class="hot-tag-boxin">
<?php foreach($label as $key=>$val){?>
<a class="hot-tag" href="<?= Url::to(['questions/labsearch'])?>?label_id=<?= Html::encode($val['queslabel_id'])?>"><?= Html::encode($val['queslabel_name'])?></a>
<?php }?>
</div></div> </div>


<div id="hotQA" class="ibox"> <div class="ibox-in"><div class="ibox-head"><div class="ibox-tit-text">热门问题</div></div><div class="ibox-body"><ul class="hot-QA-list">
<?php foreach ($hot as $key => $hotques) {?>
<li class="item"><span class="i-index"><?= Html::encode($key+1)?></span>
<?php if(!empty($user)){?>
<a style="word-break:break-all;" href="<?= Url::to(['questions/details'])?>?ques_id=<?= Html::encode($hotques['ques_id']) ?>" target="_blank"><?php echo $hotques['ques_name']?></a>
<?php }else{?>
<a style="word-break:break-all;" class="submit-reply" href="javascript:void(0)" ><?php echo $hotques['ques_name']?></a>

<?php }?>
<span>回答(<?php echo $hotques['ques_viewsum']?>)</span></li>
<?php }?>
</ul></div></div> </div>

</div>

<script>
	/*调用登录*/
    $(".submit-reply").click(function(){
        login_popup()
    })
</script>